package com.shaolei.basic;

public class BASIC_QQ {
	private static final int BUFSIZE=100;
	private String server="localhost";
	private int servPort=9980;
	
	public int get_BUFSIZE(){
		return BUFSIZE;
	}
	public String get_server(){
		return server;
	}
	public int get_servPort(){
		return servPort;
	}
	public byte[] pack(String myString){
		String information=myString+"%%";
		byte [] sendBuf2= information.getBytes();
		byte [] sendBuf=new byte[BUFSIZE];
		System.arraycopy(sendBuf2, 0, sendBuf, 0, sendBuf2.length);
		return sendBuf;
	}
	public String unpack(String myString){
		int last_index= myString.lastIndexOf("%%");
		String new_String=myString.substring(0,last_index);
		return new_String;
	}

}
